LtU Forum, Site Discussion

Monads in various languages

While working on implementing monads and comprehensions, I ran into a complication in translating comprehensions to their underlying monadic expressions. Looking at other languages for insight, I realized that all languages which make use of monads use type deduction and that this feature appears to be critical to making comprehensions work.

To translate a comprehension for a monad M, you need to translate expressions like [x+1 | x <- xm] where you know that xm:M(int) for a statically unknown monad M. But how do you typecheck "x+1", which requires that x is a numeric type? Nothing in this expression explicitly indicates that x is numeric. Thus one would need type deduction and explicit universal quantification with matching to deduce that x is numeric, or ugly explicit type specification on comprehensions like [x+1 | x::int <- xm].

My conjecture is that this is why monads happen to be widely-used only in languages supporting Hindley-Milner type deduction, while traditional languages use imperative constructs like iterators, exceptions and side-effects for roughly similar tasks. Monads would be awfully inconvenient without this syntactic sugar, which happens to rely on a rather narrowly-available language feature.

I would appreciate any counterarguments on this conjecture. Also any references to non Hindley-Milner languages supporting monads conveniently.

"The Silver Bullet"

In "No Silver Bullet --Essence and Accidents of Software Engineering", author Fred Brooks argues about the inherent unreliability in software, and that there is perhaps no 'silver bullet' that will ever be found to correct the situation.

Louis Savain has something to say about that.

In "The Silver Bullet" he counters by saying:

There Is a Silver Bullet After All The brains of humans and animals are the existence proof that there is a silver bullet. Robustness and reliability are measured in terms of defects vs. complexity. Because of its sheer astronomical complexity, the brain is the most reliable complex system in the world. In fact, the more complex the brain gets (as it learns), the more reliable it becomes. By contrast, the reliability of software gets worse as its complexity increases. Any handcrafted software with the complexity of the brain would be so riddled with bugs as to be unusable. Conversely, given their low relative complexity, any handcrafted software with the reliability of the brain would almost never fail.

This all leads into the description of Louis' brain child: Project COSA. Project COSA is a revolutionary take on software development. It removes the notion of a system of heterogeneous executable binaries, and instead presents a model consisting of a single execution kernel which passes over an entire network of 'cells' taking signals from output plugs and moving them to input sockets on other cells.

Perhaps it could be thought of as programming using software integrated circuits, but in an abstract sense.

If anything, it is certainly a departure from the normal syntax driven, algorithm based languages used now.

While still a work in progress, it is something that all LtUers would be interesting in checking out.

ICFP Contest Results

I guess many people may already know, but the ICFP contest results are out. The judge's prize went to the OCaml people for designing and using AML (Ant Meta Language) as the ant language. In the main division, the second place used C++ and Haskell, and the first place used Haskell exclusively. Might be interesting to look at the language statistics for the submissions.

Great Works in Programming Languages

A collection organized by Benjamin C. Pierce.

In September, 2004, I posted a query to the Types list asking people to name the five most important papers ever written in the area of programming languages. This page collects the responses I received. (A few are missing because I am still tracking down bibliographic information.)

Seems prime material here for Lambda.

persistence (lack of) again

I find that if I don't visit LtU for a few days, it forgets my identity.

This is very strange. The cookie I obtained a few days ago (previous visit) is supposed to be good until mid December, it says.

I use Mozilla 1.4.2 on linux. I have checked that in the settings it does not impose extra restrictions on cookie lifetimes.

Metaprogramming in Heron

I have posted a document explaining how Heron implements metaprogramming online at http://www.heron-language.com/metaprogramming.html. Heron is a C++ style imperative language, and the metaprogramming functionality leverages the type system more logically than C++ template metaprogramming does. I would be interested in hearing any comments, suggestions or criticisms of the design decisions. Thank you very much!

Free video lectures presented by Kay, Lampson, Ingalls, ...

Video lectures featuring presentations by Alan Kay, Butler Lampson, Dan Ingalls, and other computer scientists are available at the Internet Archive via this page
The currently available films are all from the late 80's, but may still be interesting to some of the LTU readers. Some highlights:

Alan Kay: Doing with Images Makes Symbols

John Backus: Function Level Programming and the FL Language

Daniel G Bobrow: Common LISP Object Standard

L. Röder's Intentional Programming Presentations

http://www.aisto.com/roeder/paper/

Three PowerPoint* presentations on "interactive source code", i.e. source code beyond ASCII. Röder worked with Charles Simonyi.

* there's a PP viewer for Macs.

Questions about Semantics.

Okay, I'm doing a self study in techniques for defining the semantics of programming languages. I have found this book( Syntax and Semantics of Programming Languages ) which seems pretty comprehensive. In particular, I was interested if there were any formalisms besides those in the book(Operational, Denotational, Domain Theory, Axiomatic, Algebraic, etc.). I was also interested in people's opinions about the strengths and weaknesses of these formalisms, and if any of them are more popular, or considered "obsolete".

Also, since I'm interested in parsing as well, I was wondering how the use of grammar formalisms to define semantics(such as Attribute Grammars, Affix Grammars, Wijngaarden grammars) is seen in comparison to these formalisms. I guess, this paper(ACM Digital Library membership required) is a good example of one way of using a grammar to define semantics. Is it considered antiquated to use grammar formalisms to do this, or is it simply not popular?

XML feed